FROM ccr.ccs.tencentyun.com/dotnet-core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80

FROM ccr.ccs.tencentyun.com/dotnet-core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["src/StarCity.Standard.Web/StarCity.Standard.Web.csproj", "src/StarCity.Standard.Web/"]
RUN dotnet restore "src/StarCity.Standard.Web/StarCity.Standard.Web.csproj"
COPY . .
WORKDIR "/src/src/StarCity.Standard.Web"
RUN dotnet build "StarCity.Standard.Web.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "StarCity.Standard.Web.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "StarCity.Standard.Web.dll"]